<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title><?php if($meta_title != ''): echo ($meta_title); ?>-<?php endif; echo C('website.title');?></title>
    <link rel="stylesheet" href="/public/Home/dist/css/zui.css">
    <link rel="stylesheet" href="/public/Home/dist/css/zui-theme.css">
    <link rel="stylesheet" href="/public/Home/common/css/login.css">
    <script type="text/javascript" src="/public/Home/dist/lib/jquery/jquery.js"></script>
    <script type="text/javascript" src="/public/Home/dist/js/zui.js"></script>
  </head>
  <body>
    <div class="container-fixed">
      <div class="col-xs-12 login-logo">
        <a href="<?php echo U('index/index');?>">
          <img src="<?php echo getImgidpath(C('website.logo'));?>" alt="">
        </a>
      </div>
      

      

    </div>
  </body>
</html>


    <div class="col-xs-12">
        <form class="form-horizontal login-form" action="">
            <div class="row login-title">
                <div class="col-xs-12 login-tab">
                    <a href="<?php echo U('user/register');?>" class="active">找回密码</a>
                </div>
            </div>
            <div class="row">
                <div class="one-loginin col-xs-7">

                    <div class="form-group">
                        <div class="col-xs-12">
                            <label class="control-label">手机号</label>
                            <input type="text" name="phone" class="form-control" id="phone"  data-toggle="tooltip" data-tip-class="tooltip-info" title="请输入手机号" placeholder="请输入手机号"   onmouseout="xxx()" >
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-xs-12">
                            <label class="control-label">验证码</label>
                            <div class="tel-box">
                                <div class="tel-btn">
                                    <button type="button" class="btn phone_code_send">发送验证码</button>
                                </div>
                                <div class="tel-input">
                                    <input type="text" name="code" data-toggle="tooltip" data-tip-class="tooltip-info" title="请输入验证码" class="form-control" placeholder="请输入验证码">
                                </div>
                            </div>
                        </div>
                    </div>
                    <script>
                        $('[data-toggle="tooltip"]').tooltip({
                            tipClass: 'tooltip-info'
                        });
                        var enable = true;
                        $('.phone_code_send').click(function(event) {
                            if(enable == false) {
                                return;
                            }
                            var phone = $('input[name=phone]').val();
                            if(phone==''){
                                $('.bk_toptips').show();
                                $('.bk_toptips span').html('手机号不能为空');
                                setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                return false;
                            }
                            enable = false;

                            $.ajax({
                                url: '<?php echo U("user/send_find");?>',
                                dataType: 'json',
                                cache: false,
                                data: {phone: phone},
                                success: function(data) {
                                    if(data.status != 0) {
                                        alert(data.message);
                                        return;
                                    }
                                    var num = 30;
                                    var interval = window.setInterval(function() {
                                        $('.phone_code_send').html(--num + 's 重发送');
                                        if(num == 0) {
                                            enable = true;
                                            window.clearInterval(interval);
                                            $('.phone_code_send').html('重发送');
                                        }
                                    }, 1000);
                                },
                                error: function(xhr, status, error) {
                                    console.log(xhr);
                                    console.log(status);
                                    console.log(error);
                                }
                            });


                        });
                        function xxx() {
                          var phone=  $('#phone').val();

                         var leng= phone.length;

                            $.ajax({

                                type: "POST",
                                url: '<?php echo U("user/send_xxx");?>',
                                dataType:'json',
                                cache: false,
                                data: {phone:phone,leng:leng},
                                success:function(data) {
                                    console.log(data);
                                  if(data==null){

                                  }else{
                                      $('.bk_toptips').show();
                                      $('.bk_toptips').html(data);
                                      setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                  }

                                   /*$('#myModal').modal();
                                    setTimeout(function(){
                                        location.href='<?php echo U("user/find");?>';
                                    },5000);*/
                                },
                                error: function(xhr, status, error) {
                                    console.log(xhr);
                                    console.log(status);
                                    console.log(error);
                                }
                            });
                        }

                        
                    </script>




                    <script>




                        function onRegisterClick() {

                            var phone = $('input[name=phone]').val();
                            var code = $('input[name=code]').val();
                            $.ajax({
                                type: "POST",
                                url: '<?php echo U("user/send_zz");?>',
                                dataType:'json',
                                cache: false,
                                data: {phone:phone,code:code},
                                success:function(data) {
                                    console.log(data)
                                    if(data != 0) {
                                        $('.bk_toptips').show();
                                        $('.bk_toptips').html(data);
                                        setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                    }
                                    $('#myModal').modal();
                                    setTimeout(function(){
                                        location.href='<?php echo U("user/find");?>';
                                    },5000);
                                },
                                error: function(xhr, status, error) {
                                    console.log(xhr);
                                    console.log(status);
                                    console.log(error);
                                }
                            });
                        }

                        function verifyPhone(phone, code) {
                            // 手机号不为空

                            // 手机号不为空
                            if(phone == '') {
                                $('.bk_toptips').show();
                                $('.bk_toptips span').html('手机号不能为空');
                                setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                return false;
                            }
                            // 手机号格式
                            if(phone.length != 11 || phone[0] != '1') {
                                $('.bk_toptips').show();
                                $('.bk_toptips span').html('手机格式不正确');
                                setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                return false;
                            }
                            if(code == '') {
                                $('.bk_toptips').show();
                                $('.bk_toptips span').html('手机验证码不能为空!');
                                setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                return false;
                            }
                            if(code.length != 4) {
                                $('.bk_toptips').show();
                                $('.bk_toptips span').html('手机验证码为4位!');
                                setTimeout(function() {$('.bk_toptips').hide();}, 2000);
                                return false;
                            }
                            return true;
                        }




                    </script>
                    <div class="form-group">
                        <div class="col-xs-12">
                            <a  class="btn btn-primary" href="javascript:" onclick="onRegisterClick();">立即注册</a>
                        </div>
                    </div>
                </div>
                <div class="other-loginin col-xs-5">
                    <div class="row">
                        <div class="col-xs-12 login-fr">
                            <p>您还可以使用其他方式登录</p>
                            <div class="login-way">
                                <a href="<?php echo U('user/login_san');?>"><i class="icon icon-qq"></i></a>
                                <a href="<?php echo U('user/login_weixin');?>"><i class="icon icon-weixin"></i></a>
                                <a href="<?php echo U('user/login_san');?>"><i class="icon icon-zhifubao"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="bk_toptips" style="color:red;"><span></span></div>
        </form>
    </div>


    <div class="modal fade" id="myModal" >
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">提示</h4>
                </div>
                <div class="modal-body">
                    <p>验证成功，进入密码重置页面</p>
                </div>
            </div>
        </div>
    </div>